<ClientManagerView:EventResourceDictionary x:Class="FacebookClient.ApplicationBarResourcesDictionary" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:FacebookClient="clr-namespace:FacebookClient" 
    xmlns:ClientManager="clr-namespace:ClientManager"
    xmlns:ClientManagerControls="clr-namespace:ClientManager.Controls" 
    xmlns:ClientManagerView="clr-namespace:ClientManager.View">

  <FacebookClient:NotConverter x:Key="NotConverter"/>
  
  <ControlTemplate x:Key="ToolbarButtonTemplate" TargetType="{x:Type ButtonBase}">
    <Grid x:Name="Root">
      <Border x:Name="Hover" Background="{DynamicResource ButtonHoverBrush}" BorderBrush="{DynamicResource ButtonHoverBorderBrush}" BorderThickness="1" CornerRadius="3" Opacity="0" />
      <ContentPresenter Margin="4,0" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="Root" Value="0.4" />
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Trigger.EnterActions>
          <BeginStoryboard>
            <Storyboard>
              <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity" To=".8" />
            </Storyboard>
          </BeginStoryboard>
        </Trigger.EnterActions>
        <Trigger.ExitActions>
          <BeginStoryboard>
            <Storyboard>
              <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity" To="0" />
            </Storyboard>
          </BeginStoryboard>
        </Trigger.ExitActions>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  
  <ControlTemplate x:Key="ToolbarToggleButtonTemplate" TargetType="{x:Type ToggleButton}">
    <Grid x:Name="Root">
      <Border x:Name="Selected" Background="{DynamicResource ButtonHoverBrush}" BorderBrush="{DynamicResource ButtonHoverBorderBrush}" BorderThickness="1" CornerRadius="3" Opacity="0" />
      <Border x:Name="Hover" Background="{DynamicResource ButtonHoverBrush}" BorderBrush="{DynamicResource ButtonHoverBorderBrush}" BorderThickness="1" CornerRadius="3" Opacity="0" />
      <ContentPresenter Margin="4,0" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="Root" Value="0.4" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Trigger.EnterActions>
          <BeginStoryboard>
            <Storyboard>
              <DoubleAnimation To="1" Duration="0:0:0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Selected" />
            </Storyboard>
          </BeginStoryboard>
        </Trigger.EnterActions>
        <Trigger.ExitActions>
          <BeginStoryboard>
            <Storyboard>
              <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Selected" />
            </Storyboard>
          </BeginStoryboard>
        </Trigger.ExitActions>
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Trigger.EnterActions>
          <BeginStoryboard>
            <Storyboard>
              <DoubleAnimation To=".5" Duration="0:0:0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Hover" />
            </Storyboard>
          </BeginStoryboard>
        </Trigger.EnterActions>
        <Trigger.ExitActions>
          <BeginStoryboard>
            <Storyboard>
              <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Hover" />
            </Storyboard>
          </BeginStoryboard>
        </Trigger.ExitActions>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <Style x:Key="MiniModeButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="Template" Value="{StaticResource ToolbarButtonTemplate}"/>
  </Style>
 
  <Style x:Key="NavigationButtonStyle" TargetType="{x:Type ButtonBase}">
    <Setter Property="Margin" Value="5,0,5,1" />
    <Setter Property="VerticalAlignment" Value="Bottom" />
    <Setter Property="Height" Value="50" />
    <Setter Property="Cursor" Value="Hand" />
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template" Value="{StaticResource ToolbarButtonTemplate}"/>
  </Style>

  <Style x:Key="BackButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="VerticalAlignment" Value="Center" />
    <Setter Property="Margin" Value="5,0" />
    <Setter Property="Width" Value="25" />
    <Setter Property="Height" Value="25" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border x:Name="ButtonBorder">
            <Border.Clip>
              <EllipseGeometry RadiusX="13" RadiusY="13" Center="12.5,12.5" />
            </Border.Clip>
            <Rectangle Fill="{DynamicResource BackArrowDrawingBrush}" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsFocused" Value="True" />
            <Trigger Property="IsDefaulted" Value="True" />
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Background" TargetName="ButtonBorder">
                <Setter.Value>
                  <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#66F3F3F3" Offset="0" />
                    <GradientStop Color="#66EBEBEB" Offset="0.5" />
                    <GradientStop Color="#66DDDDDD" Offset="0.5" />
                    <GradientStop Color="#66B1BDD6" Offset="1" />
                  </LinearGradientBrush>
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Background" TargetName="ButtonBorder">
                <Setter.Value>
                  <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFF3F3F3" Offset="0" />
                    <GradientStop Color="#FFEBEBEB" Offset="0.5" />
                    <GradientStop Color="#FFDDDDDD" Offset="0.5" />
                    <GradientStop Color="#FFB1BDD6" Offset="1" />
                  </LinearGradientBrush>
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="ButtonBorder" Value=".3" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="NavigationRadioButtonStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Margin" Value="1" />
    <Setter Property="VerticalAlignment" Value="Bottom" />
    <Setter Property="Height" Value="50" />
    <Setter Property="Cursor" Value="Hand" />
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template" Value="{StaticResource ToolbarToggleButtonTemplate}"/>
  </Style>

  <Style x:Key="FooterToggleButtonStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Margin" Value="10,1" />
    <Setter Property="VerticalAlignment" Value="Center" />
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="Height" Value="22" />
    <Setter Property="Cursor" Value="Hand" />
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template" Value="{StaticResource ToolbarToggleButtonTemplate}" />
  </Style>

  <Style x:Key="StatusTextBlockStyle" TargetType="{x:Type TextBlock}">
    <Setter Property="VerticalAlignment" Value="Bottom" />
    <Setter Property="FontSize" Value="{DynamicResource LargeFontSize3}" />
    <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
    <Setter Property="Foreground" Value="{DynamicResource IconForegroundBrush}" />
    <Setter Property="Margin" Value="0,10,0,0" />
  </Style>

  <Style TargetType="{x:Type FacebookClient:MainHeaderControl}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type FacebookClient:MainHeaderControl}">
          <Grid x:Name="Header" Background="{DynamicResource ApplicationBarBackground}" Height="85" IsEnabled="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=IsDialogActive, Converter={StaticResource NotConverter}}" >
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            
            <!-- User Profile Image in background -->
            <ClientManagerControls:FacebookImageControl Grid.Column="0" Grid.RowSpan="3" Margin="-40,0,0,0" FacebookImage="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=MeContact.Image}" FacebookImageDimensions="Big">
              <ClientManagerControls:FacebookImageControl.Template>
                <ControlTemplate TargetType="{x:Type ClientManagerControls:FacebookImageControl}">
                  <Border Width="250" HorizontalAlignment="Left">
                    <Border.Background>
                      <ImageBrush ImageSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ImageSource}" Opacity=".4" Stretch="UniformToFill" />
                    </Border.Background>
                    <Border.OpacityMask>
                      <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                        <GradientStop Offset="0" Color="Black" />
                        <GradientStop Offset=".7" Color="Black" />
                        <GradientStop Offset="1" Color="Transparent" />
                      </LinearGradientBrush>
                    </Border.OpacityMask>
                  </Border>
                </ControlTemplate>
              </ClientManagerControls:FacebookImageControl.Template>
            </ClientManagerControls:FacebookImageControl>

            <StackPanel Orientation="Horizontal" Margin="0">
              <Button x:Name="BackButton" Style="{StaticResource BackButtonStyle}" Command="NavigationCommands.BrowseBack" ToolTip="Go back"/>
              <Image Width="129" Height="19" Margin="3,0,0,0" Source="pack://application:,,,/Resources/Images/logo.png" VerticalAlignment="Stretch" HorizontalAlignment="Left" />
            </StackPanel>

            <!-- Status -->
            <TextBlock x:Name="StatusTextBlock" Grid.Column="0" Grid.Row="1" Margin="6,3,3,3" VerticalAlignment="Top" HorizontalAlignment="Left" FontFamily="{DynamicResource SansSerifFont}" FontSize="{DynamicResource MiddleFontSize}" FontWeight="Light" Foreground="{DynamicResource HeaderStatusForegroundBrush}" TextTrimming="CharacterEllipsis">
              <TextBlock.Text>
                <MultiBinding StringFormat="{}{0} {1}">
                  <Binding Source="{x:Static ClientManager:ServiceProvider.ViewManager}" Path="MeContact.Name" />
                  <Binding Source="{x:Static ClientManager:ServiceProvider.ViewManager}" Path="MeContact.StatusMessage.Message" FallbackValue="" />
                </MultiBinding>
              </TextBlock.Text>
              <TextBlock.ToolTip>
                <ToolTip Placement="Bottom" >
                  <TextBlock TextWrapping="Wrap" MaxWidth="350">
                    <TextBlock.Text>
                      <MultiBinding StringFormat="{}{0} {1}">
                        <Binding Source="{x:Static ClientManager:ServiceProvider.ViewManager}" Path="MeContact.Name" />
                        <Binding Source="{x:Static ClientManager:ServiceProvider.ViewManager}" Path="MeContact.StatusMessage.Message" FallbackValue="" />
                      </MultiBinding>
                    </TextBlock.Text>
                  </TextBlock>
                </ToolTip>
              </TextBlock.ToolTip>
            </TextBlock>

            <Canvas HorizontalAlignment="Left" Grid.Row="2" Margin="-10,0,0,0" ClipToBounds="False">
              <FacebookClient:UpdateStatusControl x:Name="UpdateStatusControl" Margin="10,0,0,0" Width="300" IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=IsOnline}" />
            </Canvas>

            <!-- Search Panel -->
            <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" Margin="10,2,5,-2">
              <FacebookClient:CommandTextBox x:Name="SearchTextBox"
                  Width="200" 
                  HorizontalAlignment="Right" 
                  Margin="5,0" 
                  VerticalAlignment="Center" 
                  CommitCommand="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=NavigationCommands.NavigateSearchCommand}" 
                  CommitCommandParameter="{Binding ElementName=SearchTextBox, Path=Text}" 
                  IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=IsOnline}" 
                  Style="{DynamicResource SearchTextBoxStyle}" 
                  Tag="Search" 
                  BannerText="Search" />
              <Button Margin="0,3"
                  VerticalAlignment="Center" HorizontalAlignment="Center" 
                  VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
                  Command="{x:Static FacebookClient:MainHeaderControl.ShowMiniModeCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                  IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=IsOnline}"
                  Style="{DynamicResource MiniModeButtonStyle}"
                  ToolTip="Switch to mini-mode window">
                <Rectangle Margin="4,3" Width="14" Height="14" Fill="{DynamicResource MiniModeIconDrawingBrush}" />
              </Button>
            </StackPanel>

            <Grid x:Name="NavigationPanel" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Margin="2,3,5,0" HorizontalAlignment="Right" IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=IsOnline}">
              <Grid.Resources>
                <Style TargetType="Rectangle">
                  <Setter Property="Height" Value="23" />
                  <Setter Property="Margin" Value="0" />
                </Style>
                <Style TargetType="TextBlock">
                  <Setter Property="Foreground" Value="White" />
                  <Setter Property="FontSize" Value="{DynamicResource SmallFontSize1}" />
                  <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
                  <Setter Property="FontWeight" Value="Light" />
                  <Setter Property="VerticalAlignment" Value="Top" />
                  <Setter Property="HorizontalAlignment" Value="Center" />
                  <Setter Property="Margin" Value="4,5,4,0" />
                </Style>
              </Grid.Resources>
              <StackPanel Orientation="Horizontal">
                <RadioButton x:Name="HomeNavigationButton" Command="{Binding Path=NavigationCommands.NavigateHomeCommand, Source={x:Static ClientManager:ServiceProvider.ViewManager}}" IsChecked="True" Style="{StaticResource NavigationRadioButtonStyle}" ToolTip="See what's new with your friends">
                  <DockPanel>
                    <TextBlock DockPanel.Dock="Bottom" x:Name="HomeNavigationButtonText" Text="Home" />
                    <Rectangle x:Name="HomeNavigationButtonImage" Fill="{DynamicResource Home3DrawingBrush}" Width="23" />
                  </DockPanel>
                </RadioButton>
                <RadioButton x:Name="FriendsNavigationButton" Command="{Binding Path=NavigationCommands.NavigateFriendsCommand, Source={x:Static ClientManager:ServiceProvider.ViewManager}}" Style="{StaticResource NavigationRadioButtonStyle}" ToolTip="Check in on your friends">
                  <StackPanel Orientation="Vertical">
                    <Rectangle Fill="{DynamicResource StackedBuddies2DrawingBrush}" Width="23" />
                    <TextBlock x:Name="FriendsNavigationButtonText" Text="Friends" />
                  </StackPanel>
                </RadioButton>
                <RadioButton x:Name="ProfileNavigationButton" Command="{Binding Path=NavigationCommands.NavigateProfileCommand, Source={x:Static ClientManager:ServiceProvider.ViewManager}}" Style="{StaticResource NavigationRadioButtonStyle}" ToolTip="Check in on yourself">
                  <StackPanel Orientation="Vertical">
                    <Rectangle Fill="{DynamicResource SingleBuddy2DrawingBrush}" Width="23" />
                    <TextBlock x:Name="ProfileNavigationButtonText" Text="Profile" />
                  </StackPanel>
                </RadioButton>
                <RadioButton x:Name="PhotoAlbumsNavigationButton" Command="{Binding Path=NavigationCommands.NavigatePhotoAlbumsCommand, Source={x:Static ClientManager:ServiceProvider.ViewManager}}" Style="{StaticResource NavigationRadioButtonStyle}" ToolTip="See everyone's photos">
                  <StackPanel Orientation="Vertical">
                    <Rectangle Fill="{DynamicResource PhotosDrawingBrush}" Width="36" />
                    <TextBlock x:Name="PhotoAlbumsNavigationButtonText" Text="Photos" />
                  </StackPanel>
                </RadioButton>
                <Button x:Name="FacebookButton" Command="{x:Static FacebookClient:MainHeaderControl.GoToFacebookCommand}" Style="{StaticResource NavigationButtonStyle}" ToolTip="Go to Facebook">
                  <StackPanel Orientation="Vertical">
                    <Rectangle Fill="{DynamicResource FacebookLogoDrawingBrush}" Width="30" />
                    <TextBlock x:Name="FacebookButtonText" Text="Facebook" />
                  </StackPanel>
                </Button>
              </StackPanel>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="IconButton" TargetType="{x:Type ButtonBase}">
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
    <Setter Property="FontSize" Value="12" />
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="Height" Value="20" />
    <Setter Property="Padding" Value="0" />
    <Setter Property="Cursor" Value="Hand" />
    <Setter Property="Foreground" Value="White" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ButtonBase}">
          <StackPanel x:Name="Root" Background="Transparent" Orientation="Horizontal">
            <Path x:Name="Icon" Margin="{TemplateBinding Padding}" Data="{TemplateBinding Tag}" Fill="#FFFFFF" Stretch="Uniform" Opacity="0.75" VerticalAlignment="Center" />
            <ContentPresenter Margin="4,0" VerticalAlignment="Center" />
          </StackPanel>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard>
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity" To="1.0" Duration="00:00:00.1" />
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard>
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity" Duration="00:00:00.2" />
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.ExitActions>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter TargetName="Root" Property="RenderTransform">
                <Setter.Value>
                  <TranslateTransform Y="1" />
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="Icon" Property="Opacity" Value="1.0" />
              <Setter Property="Opacity" Value=".25" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type FacebookClient:FooterControl}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type FacebookClient:FooterControl}">
          <Border Height="32" Background="{DynamicResource ApplicationBarBackground}">
            <Grid>
              <Grid.Style>
                <Style TargetType="{x:Type Grid}">
                  <Setter Property="IsEnabled" Value="True"/>
                  <Style.Triggers>
                    <DataTrigger Binding="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=IsDialogActive}" Value="True">
                      <Setter Property="IsEnabled" Value="False"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=IsOnline}" Value="False">
                      <Setter Property="IsEnabled" Value="False"/>
                    </DataTrigger>
                  </Style.Triggers>
                </Style>
              </Grid.Style>
              <Border Height="6" VerticalAlignment="Top" BorderBrush="#5000" BorderThickness="0,1,0,0">
                <Border.Background>
                  <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Offset="0" Color="#3000" />
                    <GradientStop Offset="1" Color="#0000" />
                  </LinearGradientBrush>
                </Border.Background>
              </Border>

              <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,12,0">

                <!-- Inbox -->
                <ToggleButton x:Name="InboxButton" Style="{DynamicResource IconButton}" Tag="{DynamicResource MailGeometry}" Padding="0,5,-4,5" Content="Inbox" Margin="28,0,0,0" ToolTipService.Placement="Top" ToolTip="See new messages" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsInboxToggled, Mode=TwoWay}" />
                <FacebookClient:NotificationCountControl DisplayCount="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=Inbox.Count}">
                  <FacebookClient:NotificationCountControl.Background>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                      <GradientStop Color="#4c94d7" Offset="0" />
                      <GradientStop Color="#1876cd" Offset="1" />
                    </LinearGradientBrush>
                  </FacebookClient:NotificationCountControl.Background>
                </FacebookClient:NotificationCountControl>

                <!-- Notifications -->
                <ToggleButton x:Name="NotificationsButton" Style="{DynamicResource IconButton}" Tag="{DynamicResource FlagGeometry}" Padding="0,2,-4,2" Content="Notifications" Margin="28,0,0,0" ToolTipService.Placement="Top" ToolTip="See new notifications" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=AreNotificationsToggled, Mode=TwoWay}" />
                <FacebookClient:NotificationCountControl x:Name="NotificationControl" DisplayCount="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=Notifications.Count}">
                  <FacebookClient:NotificationCountControl.Background>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                      <GradientStop Color="#e25423" Offset="0" />
                      <GradientStop Color="#dc2300" Offset="1" />
                    </LinearGradientBrush>
                  </FacebookClient:NotificationCountControl.Background>
                </FacebookClient:NotificationCountControl>

                <!-- Who's Online-->
                <ToggleButton x:Name="ChatButton" Style="{DynamicResource IconButton}" Tag="{DynamicResource PersonGeometry}" Padding="0,2,-4,2" Content="Who's Online" Margin="28,0,0,0" ToolTipService.Placement="Top" ToolTip="See who else is around" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsBuddyListToggled, Mode=TwoWay}" />
                <FacebookClient:NotificationCountControl DisplayCount="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=OnlineFriends.Count}">
                  <FacebookClient:NotificationCountControl.Background>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                      <GradientStop Color="#5da110" Offset="0" />
                      <GradientStop Color="#308700" Offset="1" />
                    </LinearGradientBrush>
                  </FacebookClient:NotificationCountControl.Background>
                </FacebookClient:NotificationCountControl>
              </StackPanel>

              <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
                <Button Content="Settings" Tag="{DynamicResource GearGeometry}" Margin="12,0,0,0" Padding="0,3,-6,4" Command="{x:Static FacebookClient:FooterControl.ShowSettingsCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Style="{DynamicResource IconButton}" ToolTipService.Placement="Top" ToolTip="View and change settings" />
                <Button Content="Sign Out" Tag="{DynamicResource ExitGeometry}" Margin="8,0,0,0" Padding="0,3,-4,3" Command="{x:Static FacebookClient:FooterControl.SignOutCommand}" Style="{DynamicResource IconButton}" ToolTipService.Placement="Top" ToolTip="Sign out" />
                <Button Content="Refresh" Tag="{DynamicResource RefreshGeometry}" Margin="6,0,0,0" Padding="0,3,-8,3" Command="{x:Static FacebookClient:FooterControl.RefreshCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Style="{DynamicResource IconButton}" ToolTipService.Placement="Top" ToolTip="Think you're missing something? Click to refresh now." />
              </StackPanel>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ClientManagerView:EventResourceDictionary>
